﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace StoreWeb.system.basis
{
    public partial class partsedit : System.Web.UI.Page
    {
        Maticsoft.BLL.InventoryClass blls = new Maticsoft.BLL.InventoryClass();
        Maticsoft.BLL.Parts bll = new Maticsoft.BLL.Parts();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                hidid.Value = Request.QueryString["id"];
                this.typelist.DataSource = blls.GetList("(cInvCCode like '05%') and bInvCEnd=1");
                this.typelist.DataTextField = "cInvCName";
                this.typelist.DataValueField = "cInvCCode";
                this.typelist.DataBind();
                this.typelist.Items.Insert(0, new ListItem("--请选择商品分类--", ""));
                if (!string.IsNullOrEmpty(hidid.Value))
                {
                    Maticsoft.Model.Parts md = bll.GetModel(Convert.ToInt32(hidid.Value));

                    name.Value = md.name;
                    code.Value = md.code;
                    typelist.SelectedValue = md.clnvCCode;
                }
                else
                {
                    code.Value = "BW" + DateTime.Now.ToString("yyMMddHHmmss");
                }
            }
        }
    }
}